package com.njts.homework;

class COne {
  public void f() {
    System.out.println("COne.f");
  }
}
class CTwo extends COne{
  public void f() {
    System.out.println("CTwo.f");
  }  
}
class CThree {
  public void g(COne one) {
    System.out.println("g(Cone)");
    one.f();
  }
  public void g(CTwo two) {
    System.out.println("g(Ctwo)");
    two.f();
  }
}
public class Main {
  public static void main(String[] args) {
    COne one = new CTwo();
    CThree three = new CThree();
    three.g(one);// 多态的体现
  }
}